# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsAddress do
  @moduledoc """
  USPS representation of a US address.

  ## Attributes

  *   `city` (*type:* `String.t`, *default:* `nil`) - City name.
  *   `cityStateZipAddressLine` (*type:* `String.t`, *default:* `nil`) - City + state + postal code.
  *   `firm` (*type:* `String.t`, *default:* `nil`) - Firm name.
  *   `firstAddressLine` (*type:* `String.t`, *default:* `nil`) - First address line.
  *   `secondAddressLine` (*type:* `String.t`, *default:* `nil`) - Second address line.
  *   `state` (*type:* `String.t`, *default:* `nil`) - 2 letter state code.
  *   `urbanization` (*type:* `String.t`, *default:* `nil`) - Puerto Rican urbanization name.
  *   `zipCode` (*type:* `String.t`, *default:* `nil`) - Postal code e.g. 10009.
  *   `zipCodeExtension` (*type:* `String.t`, *default:* `nil`) - 4-digit postal code extension e.g. 5023.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :city => String.t() | nil,
          :cityStateZipAddressLine => String.t() | nil,
          :firm => String.t() | nil,
          :firstAddressLine => String.t() | nil,
          :secondAddressLine => String.t() | nil,
          :state => String.t() | nil,
          :urbanization => String.t() | nil,
          :zipCode => String.t() | nil,
          :zipCodeExtension => String.t() | nil
        }

  field(:city)
  field(:cityStateZipAddressLine)
  field(:firm)
  field(:firstAddressLine)
  field(:secondAddressLine)
  field(:state)
  field(:urbanization)
  field(:zipCode)
  field(:zipCodeExtension)
end

defimpl Poison.Decoder,
  for: GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsAddress do
  def decode(value, options) do
    GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsAddress.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsAddress do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
